<template>
  <div>
    <el-form
      class="-mb-15px"
      :model="queryParams"
      ref="queryFormRef"
      :inline="true"
      label-width="auto"
    >
      <el-row :gutter="24">
        <el-col :md="20" :lg="10">
          <div class="flex">
            <el-form-item label="第一组" />
            <el-form-item prop="list.0.prop" style="width: 40%;">
              <el-select
                v-model="queryParams.list[0].prop"
                placeholder="请选择"
                clearable
                filterable
              >
                <el-option
                  v-for="dict in options"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>
            <el-form-item prop="list.0.propType" style="width: 20%;">
              <el-select
                v-model="queryParams.list[0].propType"
                placeholder="请选择"
                clearable
                filterable
              >
                <el-option
                  v-for="dict in operationConditionList"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>
            <el-form-item prop="list.0.value" style="width: 40%;">
              <el-input v-model="queryParams.list[0].value" clearable/>
            </el-form-item>
          </div>
        </el-col>
        <el-col :span="4">
          <div class="flex justify-center">
            <el-form-item prop="listType">
              <el-select
                v-model="queryParams.listType"
                placeholder="请选择"
                clearable
                filterable
                class="!w-80px"
              >
                <el-option
                  v-for="dict in operationConditionColumn"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>
          </div>
        </el-col>
        <el-col :md="20" :lg="10">
          <div class="flex">
            <el-form-item label="第二组" />
            <el-form-item prop="list.1.prop" style="width: 40%;">
              <el-select
                v-model="queryParams.list[1].prop"
                placeholder="请选择"
                clearable
                filterable
              >
                <el-option
                  v-for="dict in options"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>
            <el-form-item prop="list.1.propType" style="width: 20%;">
              <el-select
                v-model="queryParams.list[1].propType"
                placeholder="请选择"
                clearable
                filterable
              >
                <el-option
                  v-for="dict in operationConditionList"
                  :key="dict.value"
                  :label="dict.label"
                  :value="dict.value"
                />
              </el-select>
            </el-form-item>
            <el-form-item prop="list.1.value" style="width: 40%;">
              <el-input v-model="queryParams.list[1].value" clearable/>
            </el-form-item>
          </div>
        </el-col>
      </el-row>
      
      <div align="center" style="margin-bottom: 18px;">
        <el-button type="primary" @click="handleQuery">
          <Icon icon="ep:search" class="mr-5px" /> 搜索
        </el-button>
        <el-button @click="resetQuery">
          <Icon icon="ep:refresh" class="mr-5px" /> 重置
        </el-button>
      </div>
    </el-form>
  </div>
</template>

<script lang="ts" setup>
import { operationConditionList, operationConditionColumn, DictDataSelect } from '@/utils/dict'
const props = defineProps({
  options: {
    type: Array as PropType<DictDataSelect[]>,
    default: () => []
  }
})
const emit = defineEmits(['submit'])
const queryFormRef = ref() // 搜索的表单
const defaultList = [{
  prop: '',
  propType: '',
  value: ''
}, {
  prop: '',
  propType: '',
  value: ''
}]
const	queryParams	=	reactive<any>({
  listType: '&&',
  list: [...defaultList]
})
/** 搜索按钮操作 */
const handleQuery = () => {
  emit('submit', queryParams)
}

/** 重置按钮操作 */
const resetQuery = () => {
  queryFormRef.value.resetFields()
  queryParams.list = [...defaultList]
  handleQuery()
}
onMounted(() => {
      
})
    

</script>

<style lang="scss" scoped>
</style>
